/*
 * Copyright 2018-present datagear.tech
 *
 * This file is part of DataGear.
 *
 * DataGear is free software: you can redistribute it and/or modify it under the terms of
 * the GNU Lesser General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * DataGear is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with DataGear.
 * If not, see <https://www.gnu.org/licenses/>.
 */

package org.datagear.management.service.impl;

import java.util.Collection;

import org.datagear.management.service.AnalysisProjectAuthorizationListener;

/**
 * 打包一起的{@linkplain AnalysisProjectAuthorizationListener}。
 * 
 * @author datagear@163.com
 *
 */
public class BundleAnalysisProjectAuthorizationListener implements AnalysisProjectAuthorizationListener
{
	private Collection<AnalysisProjectAuthorizationListener> analysisProjectAuthorizationListeners = null;

	public BundleAnalysisProjectAuthorizationListener()
	{
		super();
	}

	public BundleAnalysisProjectAuthorizationListener(
			Collection<AnalysisProjectAuthorizationListener> analysisProjectAuthorizationListeners)
	{
		super();
		this.analysisProjectAuthorizationListeners = analysisProjectAuthorizationListeners;
	}

	public Collection<AnalysisProjectAuthorizationListener> getAnalysisProjectAuthorizationListeners()
	{
		return analysisProjectAuthorizationListeners;
	}

	public void setAnalysisProjectAuthorizationListeners(
			Collection<AnalysisProjectAuthorizationListener> analysisProjectAuthorizationListeners)
	{
		this.analysisProjectAuthorizationListeners = analysisProjectAuthorizationListeners;
	}

	@Override
	public void authorizationUpdated(String... analysisProjects)
	{
		if (this.analysisProjectAuthorizationListeners == null)
			return;

		for (AnalysisProjectAuthorizationListener al : this.analysisProjectAuthorizationListeners)
			al.authorizationUpdated(analysisProjects);
	}
}
